<template>
    <div class="error-info-modal-wrapper">
        <el-dialog :model-value="props.value" title="错误信息" :width="900" destroy-on-close>
            <div class="error-info-box">{{ message }}</div>
            <template #footer>
                <div class="dialog-footer">
                    <el-button type="primary" @click="props.close">关闭</el-button>
                </div>
            </template>
        </el-dialog>
    </div>
</template>
<script setup lang="ts">
import type { PopupBoxProps } from '@great/utils';
import { runTaskService } from '@great/services';

interface IProps extends PopupBoxProps {
    callBack: () => Promise<void>;
    rowData: Record<string, any>;
}
const props = defineProps<IProps>();

const message = ref('');

const getMessage = async () => {
    const res: any = await runTaskService.getMessage(props.rowData.id);
    message.value = res.data;
};

const init = () => {
    getMessage();
};
init();
</script>
<style scoped lang="scss">
.error-info-box {
    color: #fff;
    background-color: #333;
    border: 1px solid #ddd;
    padding: 10px;
    min-height: 300px;
    border-radius: 10px;
}
</style>
